from django.urls import re_path

from apps.areas import views

urlpatterns = [
    # 获取省份的信息
    re_path(r'^areas/$', views.ProvinceAreaView.as_view()),
    # 获取市区级信息
    re_path(r'^areas/(?P<pk>\d+)/$', views.SubAreaView.as_view()),

    # 新增收货地址
    re_path(r'^addresses/create/$', views.CreateAddressView.as_view()),

    # 展示收货地址
    re_path(r'^addresses/$', views.AddressView.as_view()),

    # 修改和删除收货地址
    re_path(r"^addresses/(?P<address_id>\d+)/$", views.UpdateDestroyAddressView.as_view()),

    # 设置默认收货地址
    re_path(r'^addresses/(?P<address_id>\d+)/default/$', views.DefaultAddressView.as_view()),

    # 修改地址标题
    re_path('^addresses/(?P<address_id>\d+)/title/$', views.UpdateTitleAddressView.as_view()),
]